//
//  FineHeaderView.swift
//  TrafficViolation
//
//  Created by eaglelive on 2017/7/8.
//  Copyright © 2017年 eaglelive. All rights reserved.
//

import Foundation
class FineHeaderView:  UIView{
    override func layoutSubviews() {
        let cfc = CarFineController()
        //单选按钮
        let radioView = UIView.init(frame: CGRect(x: 0, y: 0, width: kScreenW, height: cellH))
        radioView.backgroundColor = UIColor.white
        self.addSubview(radioView)
        let labelRadio = UILabel.init(frame: CGRect(x: oLabelLeft, y: 0, width: 120, height: cellH))
        labelRadio.font = oFontSize
        labelRadio.text = "有罚款单据？"
        radioView.addSubview(labelRadio)
        
        let radioView1 = UIView.init(frame: CGRect(x: oLabelLeft + 140, y: 0, width: 80, height: cellH))
        radioView.addSubview(radioView1)
        
        let radio1 = UIButton.init(frame: CGRect(x: 0, y: 11, width: 20, height: 20))
        radio1.setImage(UIImage(named: "radio_checked"), for: .selected)
        radio1.setImage(UIImage(named: "radio"), for: .normal)
        radio1.isSelected = true
        radio1.tag = 1001
        radio1.addTarget(cfc, action: #selector(cfc.radioBtnClick(sender:)), for: UIControlEvents.touchUpInside)
        radioView1.addSubview(radio1)
        
        let radioLabel1 = UILabel.init(frame: CGRect(x: 25, y: 0, width: 40, height: cellH))
        radioLabel1.font = oFontSize
        radioLabel1.text = "有"
        radioView1.addSubview(radioLabel1)
        
        let radioView2 = UIView.init(frame: CGRect(x: oLabelLeft + 220, y: 0, width: 80, height: cellH))
        radioView.addSubview(radioView2)
        
        let radio2 = UIButton.init(frame: CGRect(x: 0, y: 11, width: 20, height: 20))
        radio2.setImage(UIImage(named: "radio_checked"), for: .selected)
        radio2.setImage(UIImage(named: "radio"), for: .normal)
        radio2.isSelected = false
        radio2.tag = 1000
        radio2.addTarget(cfc, action: #selector(cfc.radioBtnClick(sender:)), for: UIControlEvents.touchUpInside)
        radioView2.addSubview(radio2)
        
        let radioLabel2 = UILabel.init(frame: CGRect(x: 25, y: 0, width: 40, height: cellH))
        radioLabel2.font = oFontSize
        radioLabel2.text = "没有"
        radioView2.addSubview(radioLabel2)
        
        let lab = UILabel.init(frame: CGRect(x: oLabelLeft, y: cellH, width: kScreenW - 2*oLabelLeft, height: 1))
        lab.backgroundColor = separatorColor
        radioView.addSubview(lab)
    }
}
